﻿using System;
using UnityEngine;
using UnityEngine.U2D;
using Object = UnityEngine.Object;


public class ResourceUtility
{
    #region 构造ResourceManager单例

    private ResourceUtility()
    {
    }

    //外部调用一次初始化--游戏进入的时候
    public void Init()
    {
    }

    private static readonly Lazy<ResourceUtility>
        _instance = new Lazy<ResourceUtility>(() => new ResourceUtility());

    public static ResourceUtility Instance => _instance.Value;

    #endregion

    #region 加载资源

    public T LoadResource<T>(string resourcePath) where T : Object
    {
        var result = Resources.Load<T>(resourcePath);

        return result;
    }

    #endregion
}